package com.kylin.dal.entity.authority;

import com.kylin.shared.common.entity.BaseEntry;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 权限系统的角色数据项
 * @author Damon S.
 * @version v1.0.1
 * @date 2019年11月01日 10:57
 */
@Entity
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table(name = "t_authority_relation", catalog = "db_kylin_artwork")
public final class RelationEntry extends BaseEntry implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column private Long id;

    @Column(name = "subject_id")
    private Long subjectId;

    @Column private Integer type;

    @Column(name = "role_ids", columnDefinition = "TEXT")
    private String roleIds;

    @Column(columnDefinition = "TINYINT")
    private Integer removed;
}
